import ProTableComp, { type ColumnsType   } from '@/components/ProTableComp';
import { adminFinancial } from '@/api/modules/adminUser';

import "./index.less";

const Page = () => {
	const columns: ColumnsType[] = [{
		title: '时间',
		dataIndex: 'create_time',
		width: '180',
		hideSearch: true,
	}, {
		title: '操作人',
		dataIndex: 'update_admin_name',
		width: '180',
		valueType: 'text',
	}, {
		title: '收支类型',
		dataIndex: 'mode',
		width: '180',
		valueType: 'select',
		valueEnum: () => ({
			1: { text: '收入', status: 'green' },
			2: { text: '支出', status: 'red' },
		}),
	}, {
		title: '交易类型',
		dataIndex: 'type',
		width: '180',
		valueType: 'select',
		valueEnum: () => ({
			1: { text: '重置', status: '' },
			2: { text: '自动化(上架)', status: '' },
			3: { text: '自动化(重新上架)', status: '' },
			4: { text: '自动化(重新发布)', status: '' },
		}),
	}, {
		title: '日期',
		dataIndex: 'dateRange',
		key: 'dateRange',
		width: 100,
		valueType: 'dateRange',
		hideTable: true,
	}, {
		title: '变动前金额',
		dataIndex: 'before_balance',
		width: '180',
		hideSearch: true,
	}, {
		title: '变动金额',
		dataIndex: 'change_balance',
		width: '180',
		hideSearch: true,
	}, {
		title: '变动后金额',
		dataIndex: 'current_balance',
		width: '180',
		hideSearch: true,
	}, {
		title: '备注',
		dataIndex: 'remark',
		width: '180',
		hideSearch: true,
	},];

	return (
		<div className="card content-box admin-financial">
			<ProTableComp
				tableName="财务中心"
				request={adminFinancial}
				columns={columns}
			/>
		</div>
	);
};

export default Page;
